import { saveAs } from 'file-saver'
export const exportImg = (e, map) => {
  if (e == 5) {
    // console.log('fgx')
    map.un('click', window.handleClick)
    map.interactions.pop()
    map.once('postcompose', function (event) {
      const canvas = event.context.canvas
      // console.log(canvas)
      canvas.toBlob(function (blob) {
        // console.log(blob)
        saveAs(blob, 'mapExport.png')
      })
    })
    map.rederSync
  }
}
